#!/usr/bin/perl
use strict;
use DBI;

# load config
if(-f "$ENV{HOME}/.bictransfer") {
	{ package Settings; do "$ENV{HOME}/.bictransfer" }
}
if (!defined %Settings::db) {
    print "\n\tERROR: Config file error - could not load config settings\n\n"; exit 33;
} 

my $tarchiveID = $ARGV[0];
unless($tarchiveID) {
	print "Usage: $0 <TarchiveID>\n";
	exit(1);
}

my $dbh = DBI->connect(&Settings::dbiConnect()) or die "Failed to connect to tarchive db";

$dbh->do("UPDATE tarchive SET PendingTransfer=1 WHERE TarchiveID=".$dbh->quote($tarchiveID));

$dbh->disconnect();
